home *** CD-ROM | disk | FTP | other *** search
Wrap
ccccrrrreeeeaaaatttt((((2222)))) ccccrrrreeeeaaaatttt((((2222)))) NNNNAAAAMMMMEEEE _cccc_rrrr_eeee_aaaa_tttt - create a new file or rewrite an existing one SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_>>>> _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_ssss_tttt_aaaa_tttt_...._hhhh_>>>> _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ffff_cccc_nnnn_tttt_llll_...._hhhh_>>>> _iiii_nnnn_tttt _cccc_rrrr_eeee_aaaa_tttt_((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_p_a_t_h_,,,, _mmmm_oooo_dddd_eeee______tttt _m_o_d_e_))))_;;;; DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN _cccc_rrrr_eeee_aaaa_tttt creates a new ordinary file or prepares to rewrite an existing file named by the path name pointed to by _p_a_t_h. If the file exists, the length is truncated to 0 and the mode and owner are unchanged. If the file does not exist the file's owner ID is set to the effective user ID of the process. The group ID of the file is set to the effective group ID of the process or to the group ID of the directory in which the file is being created. This is determined as follows: If the underlying filesystem was mounted with the BSD file creation semantics flag [see _ffff_ssss_tttt_aaaa_bbbb(4)] or the _SSSS______IIII_SSSS_GGGG_IIII_DDDD bit is set [see _cccc_hhhh_mmmm_oooo_dddd(2)] on the parent directory, then the group ID of the new file is set to the group ID of the parent directory, otherwise it is set to the effective group ID of the calling process. The mode bits of the file are based on the value of _mmmm_oooo_dddd_eeee, modified as follows: If the group ID of the new file does not match the effective group ID or one of the supplementary group IDs, the _SSSS______IIII_SSSS_GGGG_IIII_DDDD bit is cleared. All bits set in the process file mode creation mask are cleared [see _uuuu_mmmm_aaaa_ssss_kkkk(2)]. The ``save text image after execution bit'' of the mode is cleared [see _cccc_hhhh_mmmm_oooo_dddd(2) for the values of _mmmm_oooo_dddd_eeee] Upon successful completion, a write-only file descriptor is returned and the file is open for writing, even if the mode does not permit writing. The file pointer is set to the beginning of the file. The file descriptor is set to remain open across _eeee_xxxx_eeee_cccc system calls [see _ffff_cccc_nnnn_tttt_llll(2)]. A new file may be created with a mode that forbids writing. The call _cccc_rrrr_eeee_aaaa_tttt_((((_p_a_t_h_,,,, _m_o_d_e_)))) is equivalent to: PPPPaaaaggggeeee 1111 ccccrrrreeeeaaaatttt((((2222)))) ccccrrrreeeeaaaatttt((((2222)))) _oooo_pppp_eeee_nnnn_((((_p_a_t_h_,,,, _OOOO______WWWW_RRRR_OOOO_NNNN_LLLL_YYYY _|||| _OOOO______CCCC_RRRR_EEEE_AAAA_TTTT _|||| _OOOO______TTTT_RRRR_UUUU_NNNN_CCCC_,,,, _m_o_d_e_)))) _cccc_rrrr_eeee_aaaa_tttt fails if one or more of the following are true: _EEEE_AAAA_CCCC_CCCC_EEEE_SSSS Search permission is denied on a component of the path prefix. _EEEE_AAAA_CCCC_CCCC_EEEE_SSSS The file does not exist and write permission on the directory in which the file is to be created is denied. _EEEE_AAAA_CCCC_CCCC_EEEE_SSSS The file exists and write permission is denied. _EEEE_AAAA_GGGG_AAAA_IIII_NNNN The file exists, mandatory file/record locking is set, and there are outstanding record locks on the file [see _cccc_hhhh_mmmm_oooo_dddd(2)]. _EEEE_FFFF_AAAA_UUUU_LLLL_TTTT _p_a_t_h points outside the allocated address space of the process. _EEEE_FFFF_BBBB_IIII_GGGG The file does not exist and the file size limit of the process is set to 0 [see _gggg_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt(2)]. _EEEE_IIII_SSSS_DDDD_IIII_RRRR The named file is an existing directory. _EEEE_IIII_NNNN_TTTT_RRRR A signal was caught during the _cccc_rrrr_eeee_aaaa_tttt system call. _EEEE_LLLL_OOOO_OOOO_PPPP Too many symbolic links were encountered in translating _p_a_t_h. _EEEE_MMMM_FFFF_IIII_LLLL_EEEE The process has too many open files [see _gggg_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt(2)]. _EEEE_NNNN_AAAA_MMMM_EEEE_TTTT_OOOO_OOOO_LLLL_OOOO_NNNN_GGGG The length of the _p_a_t_h argument exceeds {_PPPP_AAAA_TTTT_HHHH______MMMM_AAAA_XXXX}, or the length of a _p_a_t_h component exceeds {_NNNN_AAAA_MMMM_EEEE______MMMM_AAAA_XXXX} while ______PPPP_OOOO_SSSS_IIII_XXXX______NNNN_OOOO______TTTT_RRRR_UUUU_NNNN_CCCC is in effect. _EEEE_NNNN_OOOO_TTTT_DDDD_IIII_RRRRA component of the path prefix is not a directory. _EEEE_NNNN_OOOO_EEEE_NNNN_TTTT A component of the path prefix does not exist. _EEEE_NNNN_OOOO_EEEE_NNNN_TTTT The path name is null. _EEEE_RRRR_OOOO_FFFF_SSSS The named file resides or would reside on a read-only file system. _EEEE_NNNN_FFFF_IIII_LLLL_EEEE The system file table is full. _EEEE_NNNN_OOOO_SSSS_PPPP_CCCC The file system is out of inodes. _EEEE_TTTT_IIII_MMMM_EEEE_DDDD_OOOO_UUUU_TTTT The object of the write is located on a remote system which is not available [see _iiii_nnnn_tttt_rrrr_oooo(2)]. SSSSEEEEEEEE AAAALLLLSSSSOOOO _cccc_hhhh_mmmm_oooo_dddd(2), _cccc_llll_oooo_ssss_eeee(2), _dddd_uuuu_pppp(2), _ffff_cccc_nnnn_tttt_llll(2), _gggg_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt(2), _llll_ssss_eeee_eeee_kkkk(2), _oooo_pppp_eeee_nnnn(2), _rrrr_eeee_aaaa_dddd(2), _uuuu_mmmm_aaaa_ssss_kkkk(2), _wwww_rrrr_iiii_tttt_eeee(2), _ssss_tttt_aaaa_tttt(5) PPPPaaaaggggeeee 2222 ccccrrrreeeeaaaatttt((((2222)))) ccccrrrreeeeaaaatttt((((2222)))) DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS Upon successful completion a non-negative integer, namely the lowest numbered unused file descriptor, is returned. Otherwise, a value of -1 is returned, no files are created or modified, and _eeee_rrrr_rrrr_nnnn_oooo is set to indicate the error. PPPPaaaaggggeeee 3333